import { BaseEntity } from '@cool-midway/core';
import { Column, Entity, Index } from 'typeorm';

/**
 * anchorDynamic模块-动态信息
 */
@Entity('anchor_dynamic')
export class AnchorDynamicEntity extends BaseEntity {
  @Index()
  @Column({ comment: '主播', length: 100 })
  anchorId: string;

  @Column({ comment: '主播名称', length: 100 })
  anchorName: string;

  @Column({ comment: '动态内容', type: 'text' })
  content: string;

  @Column({ comment: '发布时间', type: 'datetime' })
  publishTime: Date;

  @Column({ comment: '点赞数', default: 0 })
  likes: number;

  @Column({ comment: '评论数', default: 0 })
  comments: number;

  @Column({ comment: '观看数', default: 0 })
  views: number;

  @Column({ comment: '动态类型 0-普通 1-热门', default: 0, type: 'tinyint' })
  type: number;

  @Column({ comment: '封面图', nullable: true })
  coverImage: string;

  @Column({ comment: '主播图片', nullable: true })
  avatar: string;

  @Column({ comment: '动态图', nullable: true, type: 'json' })
  dynamicImages: string[];
}
